<template>
  <div class="categories">
    <template v-for="(item, index) in categories" :key="index">
      <div class="cateItem">
        <img :src="item.pictureUrl" alt="" />
        {{ item.title }}
      </div>
    </template>
  </div>
</template>

<script setup>
import { storeToRefs } from "pinia";
import useHomeStore from "../../../stores/modules/homeStore";
const homeStore = useHomeStore();
const { categories } = storeToRefs(homeStore);
</script>

<style lang="less" scoped>
.categories {
  display: flex;
  flex-direction: row;
  width: 100%;
  overflow-x: scroll;
  overflow-y: hidden;
  // 隐藏滚动条
  scrollbar-width: none;
  &::-webkit-scrollbar {
    display: none;
  }
  .cateItem {
    text-align: center;
    margin: 0 10px;
    img {
      width: 60px;
    }
  }
}
</style>
